/*
 * @Author: 晟松
 * @Date: 2021-12-16 23:48:49
 * @LastEditors: 晟松
 * @LastEditTime: 2022-02-13 13:30:34
 * @FilePath: \volunteer-vue3-admin\src\myApi\user.js
 * @Description:
 */
import { _axios } from "../plugins/axios";

export const info = (data) => {
    return _axios.request({
        url: "/user/info",
        method: "post",
        data,
    });
};

export const mine = (data) => {
    return _axios.post("/user/mine", data);
};

export const create = (data) => {
    return _axios.post("/user/create", data);
};

export const update = (data) => {
    return _axios.put("/user", data);
};

// 直接设置密码
export const updatePassword = (data) => {
    return _axios.post("/user/password", data);
};

export const deleteUser = (data) => {
    // 这里的这种形式是因为delete接口的特殊处理
    // https://blog.csdn.net/STUDENTstudent123/article/details/102969839
    return _axios.delete("/user", { data });
};

// 更新密码
export const updatePwd = (data) => {
    return _axios.post("/user/updatePwd", data);
};

export const getAllCommunity = (data) => {
    return _axios.get("/user/getAllCommunity", data);
};
export const getAllCommunityInfo = (data) => {
    return _axios.get("/user/getAllCommunityInfo", data);
};

export const getAllSchool = (data) => {
    return _axios.get("/user/getAllSchool", data);
};

export const getAllSchoolInfo = (data) => {
    return _axios.get("/user/getAllSchoolInfo", data);
};

export const getIntegralRank = (data) => {
    return _axios.get("/user/getIntegralRank", data);
};
